<%=
all_users = {
  p('blobstore.director.user') => p('blobstore.director.password'),
}

if p('blobstore.agent.user', nil).nil? && !p('blobstore.enable_signed_urls')
  raise "Either 'blobstore.agent.user' must be set or 'blobstore.enable_signed_urls' must be true."
end

if_p('blobstore.agent.user') do |agent_user|
  all_users[agent_user] = p('blobstore.agent.password')
end

if_p('blobstore.agent.additional_users') do |agent_additional_users|
  agent_additional_users.each do |agent_user|
    all_users[agent_user['user']] = agent_user['password']
  end
end

all_users.map{ |u, p| "#{u}:{PLAIN}#{p}" }.join("\n")
%>
